home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / serial / callback.001 / callback~ / callback / lib / dbase / ageof.c < prev    next >
C/C++ Source or Header  |  1996-07-22  |  352b  |  19 lines

  1.  
  2. #include "dbase.p"
  3.  
  4. unsigned ageof(char *fname)
  5. {
  6.     struct stat
  7.         ss;
  8.     unsigned
  9.         secs;
  10.         
  11.     if (stat(fname, &ss))
  12.         return (0);                     /* no file: no time lapsed */
  13.     
  14.     secs = (unsigned)difftime(time(NULL), ss.st_mtime);
  15.     
  16.     log(log_on, "Age of '%s': %u secs", fname, secs);
  17.     return (secs);
  18. }
  19.